import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'amfe-flexible'; //引入rem自适应
import '@/assets/css/reset.css'
import filter from './filter/filter'
import $http from './utils/api'


Vue.config.productionTip = false
Vue.mixin({
  data(){
    return {
      form:{}
    }
  },
  mounted(){

  },
  filters:filter,
  methods:{
    handleTo(url,paramas){
      if(url){
        this.$router.push({
          path:url,
          query:paramas
        })
      }
    },
    getBase64Image(img){  
      var canvas = document.createElement("canvas");  
      canvas.width = img.width;  
      canvas.height = img.height;  
      var ctx = canvas.getContext("2d");  
      ctx.drawImage(img, 0, 0, img.width, img.height);  
      var ext = img.src.substring(img.src.lastIndexOf(".")+1).toLowerCase();  
      var dataURL = canvas.toDataURL("image/"+ext);  
      return dataURL;  
    }  
  }
})
Vue.prototype.$http=$http
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
